<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    body {
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      background: #1d1d1d;
    }
    .btn {
      display: block;
      box-sizing: border-box;
      width: 100px;
      height: 32px;
      line-height: 32px;
      padding: 0 10px;
      text-align: center;
      color: red;
      font-weight: 700;
      border-radius: 4px;
      border:none;
      transition: color .2s, background 1s;
      cursor: pointer;
      outline: none;
    }
    .btn:hover {
      color: #fff;
      background: #0984e3;
    }
    .banned {
      color: #eee;
      background:gray;
      pointer-events: none;
    }
  </style>
</head>
<body>
  <button class="btn">发送</button>
</body>
<script>
  let btn =document.querySelector('.btn')
  function countTime () {
    return function () {
      let i = 9;
      btn.classList.add('banned')
      timerOne = setInterval(() => {
        btn.innerText = '待接收（'+ i +'）'
        i = i-1
        if(i<0) {
          clearInterval(timerOne)
          btn.innerText = '发送'
          btn.classList.remove('banned')
        }
      }, 1000);
    }
  }

  btn.addEventListener('click',countTime())
</script>
</html>